package com.xshiwu.tg.mapper;

import com.xshiwu.tg.pojo.ProductPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ProductMapper {
    // 获取产品
    ProductPo getProduct(Long id);

    int decreaseProduct(@Param("id") Long id, @Param("quantity") Integer quantity);

    // 减少库存
    int decreaseProduct(@Param("id") Long id, @Param("quantity") Integer quantity,@Param("version") int version);

}
